<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/public.css">
    <link rel="stylesheet" href="./css/register.css">

    <script src="./js/libs/jQuery.js"></script>
    <script src="./js/register.js"></script>
</head>

<body>
    <header>
        <div class="head-inner">
            <div class="head-inner-l"></div>
            <div class="head-inner-r"></div>
        </div>
    </header>
    <div class="c-body">
        <div class="c-content">
            <div class="c-login clear_fix  fr">
                <div class="form-box">
                    <div class="fb-head">
                        <div class="fb-head-l">扫码登录</div>
                        <div class="fb-head-r">账户登录</div>
                    </div>
                    <div class="c-body1">
                        <div class="fb-content">
                            <div class="fb-imgbox">
                                <img src="/erweima.png" alt="">
                            </div>
                        </div>
                        <p class="fb-txt">
                            <span></span>打开<i>唯品会app个人中心,</i>扫一扫登录
                        </p>
                    </div>
                    <div class="c-body2">
                        <div class="fb-content">
                            <form action="" class="user-login">
                                <div class="user-name">
                                    <input type="text" placeholder="手机号/用户名/绑定邮箱" id="uname">
                                    <span></span>
                                </div>
                                <div class="user-message"></div>
                                <div class="user-pwd">
                                    <input type="text" placeholder="密码" id="upwd">
                                    <span></span>
                                </div>
                                <div class="user-message"></div>
                                <p class="fb-txt">
                                    <i>短信验证密码</i>
                                    <a href="">忘记密码</a>
                                </p>
                                <button class="btn">登录</button>
                            </form>
                        </div>
                    </div>
                    <div class="fb-foot">
                        <div class="fb-foot-h">
                            <span></span>
                        </div>
                        <ul class="fb-ul">
                            <li>新浪微博</li>
                            <li>QQ</li>
                            <li>支付宝</li>
                            <li>更多</li>
                            <li>免费注册</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        $(function() {
            $("form").submit(function () {
                $.ajax({
                    url:"./account/register",
                    type:"post",
                    data:$("form").serialize()
                }).then(function(res) {
                    console.log(res);
                    if(res.data && res.code == 200) {
                        // 把当前信息的登录人信息保存到sessionstorage
                        sessionStorage.setItem("userInfo",JSON.stringify(res.data));
                    }
                })
            })
            return false;
        })
    </script>
</body>

</html>